	<!-- 包含头部 -->
	<include file="header" />
	<!-- 头部END -->
    
    <link rel="stylesheet" href="__STATIC__/baguettebox/baguettebox.min.css">
    <style type="text/css">
    	.sr-bdimgshare{
    		z-index: 1000009 !important;
    	}
    	.bdshare_dialog_box{
    		z-index: 1000011 !important;
    	}
    	.bdshare_popup_box {
    		z-index: 1000010 !important;
    	}
		.bd_weixin_popup{
			z-index: 1000012 !important;
		}
		#baguetteBox-overlay .full-image img{
			cursor: pointer;
		}
    </style>


        <div class="pt80 container">
	        <div class="sub-menu clear">
				<div class="menu-item clear">
					<div class="menu-all gallery_menu">
						<a href="/home?category={$category_items[0]['id']}">{$category_items.0.title}</a><span>></span>
						<a href="javascript:void(0);" class="gallery_menu_title">{$listitems.0.title}</a>
					</div>
				</div>
			</div>
			<div class="gallery gallery_js">
				<ul class="clear gallery_item">
                    <volist name='data' id='d' key='k' >

					<li class="fl">
						<a href="{$d.s_url}" title="{$d.title}" data-tag="share_img{$k}" data-pid="{$d.id}" data-href="/gallery_detail/id/{$d['id']}" class='tager'>
							<div class="gallery_img">
								<img src="{$d.s_url}" alt="{$d.title}" title="{$d.title}">
							</div>
							<div class="gallery_text">
								<p class="gallery_title" title="{$d.title}">
									{$d.title}
								</p>
								<div class="gallery_t">
                                    <p class="gallery_address">品牌：{$listitems.0.brand|default='暂无'}</p>
									<p class="gallery_time">品类：{$listitems.0.class|default='暂无'}</p>
								</div>
							</div>
						</a>
					</li>
                    </volist>
				</ul>
			</div>
		</div>
		<div class="page">
	        {$_page|default=''}
                <?php if (!empty($_page)): ?>
	        <form method='get' action="/home/index" class="find_page">
	        	跳转到第
	            <input type="text" class="find_page_input" name="page" value="">
	            页
	            <input type="hidden" name="category" value="{$category}">
	            <input type="submit" id="find_page_submit" value="确定">
	        </form>
                <?php endif; ?>
	    </div>
		<!-- 包含脚部 -->
		<include file="footer" />
		<!-- 脚部END -->
<script src="__STATIC__/baguettebox/baguettebox.js"></script> 
<script>

	$(function() {
		baguetteBox.run('.gallery_js', {
	       animation: 'fadeIn',    
	   });

		$('.gallery_item').on('click','.gallery_img',function(){
			var imgHeight = $('body').find('.full-image').height();
			$('body').find('.full-image').css({
				'line-height':imgHeight+'px'
			})
		})
		$('body').on('click','.full-image img',function(){
	        var detail_url = $(this).data('href');
	                //alert($(this).data('tag'))
			window.open(detail_url);
		})
	})
	

</script>
<script>
$(function(){
	$('body').on('mouseover','.full-image .shareHtml',function(){
		//$('.shareHtml').show();
	})

	$('body').on('mouseover','.full-image figure',function(){
		//$('.shareHtml').show();
		var text = '刚刚在梧桐珆发现了 #' + $('.gallery_menu_title').html() + ' # 果断分享；';
		var galleryImg = $(this).find('img').attr('src'); 
		console.log(galleryImg);
		var galleryUrl = $(this).find('img').data('href'); 
		var share_img = $(this).find('img').data('tag'); 
		var galleryUrlHead = window.location.origin;
		// console.log(galleryUrlHead+galleryUrl);
		window._bd_share_config={
	    "common":{
	        "bdSnsKey":{},
	        "bdText":text,
	        "bdMini":"2",
	        "bdMiniList":false,
	        "bdPic":galleryImg,
	        //"bdUrl" : galleryUrlHead+galleryUrl, 	
	        "bdStyle":"0",
	        "bdSize":"24"
	        },
	 //    "share" : {
		// 	// "bdSize" : 16
		// }


	    "image": [
	    	<?php for ($i = 1; $i <= count($data); $i++): ?>
	    		{
					 "tag" : "share_img{$i}",
					 "viewList":["weixin","tsina","qzone","tqq","douban","renren"],
					 "viewSize" : '24'
				},
	    	<?php endfor; ?>
	    	
			]

	    };
	    // var shareScript =document.createElement('script');
     //    shareScript.setAttribute('class', 'shareScript');
     //    shareScript.setAttribute('src', 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js');
	   // var shareScript = "<script src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=414467'><\/script>";
	   with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
	    // with(document)0[(getElementsByTagName('head')[0]||body).append(shareScript)];
    })
    // $('body').on('mouseout','.full-image figure',function(){
    // 	//$('.shareHtml').hide();
    // 	//$('.shareScript').remove();


    // })
})
</script>	